<?php

require_once('OFC/OFC_Chart.php');

$archivo=file("../poblacion.log");
$data_1 = array();
$data_2 = array();
$data_3 = array();


$i=0;
foreach ($archivo as $linea){

    $data_1[] = $i;
    $data_2[] = strtok($linea, ", \n");
    $data_3[] = strtok(", \n");
    $i++;
    if($i==10)break;
}

$line_dot = new OFC_Charts_Line_Dot();
$line_dot->set_width( 2 );
$line_dot->set_colour( '#DFC329' );
$line_dot->set_dot_size( 1 );
$line_dot->set_values( $data_1 );

$line_hollow = new OFC_Charts_Line_Hollow();
$line_hollow->set_width( 2 );
$line_hollow->set_colour( '#6363AC' );
$line_hollow->set_dot_size( 1 );
$line_hollow->set_values( $data_2 );

$line = new OFC_Charts_Line();
$line->set_width( 2 );
$line->set_colour( '#5E4725' );
$line->set_dot_size( 1 );
$line->set_values( $data_3 );

$y = new OFC_Elements_Axis_Y();
$y->set_range( 0, 300, 0 );

$chart = new OFC_Chart();
$chart->set_title( new OFC_Elements_Title( 'Poblacion de celulas' ) );
$chart->set_y_axis( $y );
//
// here we add our data sets to the chart:
//
$chart->add_element( $line_dot );
$chart->add_element( $line_hollow );
$chart->add_element( $line );



echo $chart->toPrettyString();





?>




